package samples.d3.image 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.filters.GlowFilter;
	import flash.geom.Point;
	import flash.utils.setInterval;
	import samples.BaseSample;
	import utils.GeomUtils;
	
	/**
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class Outline extends BaseSample 
	{
		private var bd:BitmapData;
		private var points:Array;
		public function Outline() 
		{
			
			bd = new BitmapData( 500,500, true, 0 );
			addChild( new Bitmap( bd ) );
			
			points = new Array( new Point() );
			//interval = setInterval( update, 1000 );
			update();
		}
		
		private function update():void 
		{
			
			
			bd.perlinNoise( 100,100, 3, 0,true, true, 7, true, points );
			
			bd.threshold( bd, bd.rect, new Point(), '<=', 0xFF999999, 0 );
			bd.threshold( bd, bd.rect, new Point(), '!=', 0, 0xFF333333 );
			
			bd.applyFilter( bd, bd.rect, new Point(), new GlowFilter( 0xFFFFFF, 1, 1.1, 1.1, 10, 3, true, false ) );
			center();
			
		}
		
	}

}